//
//  CustomBtnStyle.swift
//  NaiCha
//
//  Created by 唐安坤 on 2024/7/4.
//

import SwiftUI

struct CustomBtnStyle: ButtonStyle {
    func makeBody(configuration: Configuration) -> some View {
        configuration.label
            .background(LinearGradient(colors: [Color("btn1", bundle: nil),Color("btn2", bundle: nil)], startPoint: .leading, endPoint: .trailing))
            .cornerRadius(10)
            .scaleEffect(configuration.isPressed ? 0.9 : 1)
    }
}

struct RotateBtnStyle: ButtonStyle {
    func makeBody(configuration: Configuration) -> some View {
        configuration.label
            .foregroundStyle(.white)
            .padding()
            .background(.blue)
            .cornerRadius(10)
            .rotationEffect(configuration.isPressed ? Angle(degrees: 180) : Angle(degrees: 0))
    }
}
